package com.hyt.it.ogt.pj.progress;

import com.hyt.progress.creator.anno.ProgressAnno;
import com.hyt.progress.creator.policy.ProgressLockKeyCreator;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.reflect.MethodSignature;

import static com.hyt.model.cloudefile.enums.JobKeyEnum.PJEXPORTJOB_OBJECTIVESCOREDATADOWNLOAD;

/**
 * 中小板客观题成绩导出
 *
 * @author zhoumiao
 * @since 2022/12/14 22:32
 **/
public class ObjectiveScoreScoreDataDownloadLockKeyCreator implements ProgressLockKeyCreator {
    public static final String LOCK_PARAM = "projectId";
    @Override
    public String createLockKey(ProceedingJoinPoint pjp, ProgressAnno progressAnno) {
        String className = pjp.getTarget().getClass().getName();
        String methodName = ((MethodSignature) pjp.getSignature()).getMethod().getName();
        return className + methodName + getQueryParamValue(pjp, LOCK_PARAM) + PJEXPORTJOB_OBJECTIVESCOREDATADOWNLOAD.getKey();
    }

}
